package com.example.satokendemospringboot.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.util.SaResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 这里用于测试 角色是否生效
 *
 */
@RestController
@RequestMapping("/admin/")
public class AdminController {

    // 查询 Token 信息  ---- http://localhost:8081/admin/add
    @SaCheckPermission("admin:add")
    @RequestMapping("add")
    public SaResult add() {
        return SaResult.data("add");
    }

    // 查询 Token 信息  ---- http://localhost:8081/admin/update
    @SaCheckPermission("admin:update")
    @RequestMapping("update")
    public SaResult update() {
        return SaResult.data("update");
    }

    // 查询 Token 信息  ---- http://localhost:8081/admin/list
    @SaCheckPermission("admin:list")
    @RequestMapping("list")
    public SaResult list() {
        return SaResult.data("list");
    }

    // 查询 Token 信息  ---- http://localhost:8081/admin/delete
    @SaCheckPermission("admin:delete")
    @RequestMapping("delete")
    public SaResult delete() {
        return SaResult.data("delete");
    }




}
